package com.zzyl.mapper;


import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingProjectMapper {


    /**
     * 分页查询
     *
     * @param name
     * @param status
     * @return
     */
    Page<List<NursingProject>> selectByPage(String name, Integer status);


    /**
     * 根据id查询护理项目
     *
     * @param id
     * @return
     */
    NursingProject selectById(Long id);


    /**
     * 查询所有护理项目
     *
     * @return
     */
  List<NursingProject> getAllProject();


    /**
     * 根据名称查询护理项目
     *
     * @param name
     * @return
     */
    @Select("select * from nursing_project where name=#{name};")
    NursingProject selectByName(String name);


    /**
     * 新增
     *
     * @param addNursingProject
     */
    void addNursingProject(NursingProject addNursingProject);


    /**
     * 编辑
     *
     * @param nursingProject
     */
    void edit(NursingProject nursingProject);


    /**
     * 启用禁用
     *
     * @param id
     * @param status
     */
    void enableOrDisable(Long id, Integer status);


    /**
     * 删除
     *
     * @param id
     */
    @Delete("delete from nursing_project where id=#{id};")
    void deleteProject(Long id);
}
